---@class RedRob.AiMgr
local AiMgr = RedRob.CreateSingleton("AiMgr")
local this = AiMgr
function AiMgr.OnCreate()

end
function AiMgr.OnDestroy()

end
---@param actor RedRob.Pawn
function AiMgr.AddAi(actor,aiType)
    if not actor then return end
    if actor.ai then
        this.AiToPool(actor.ai)
    end
    local ai = this.CreateAi(aiType)
    ai:BaseCreate(actor)
    actor:SetAi(ai)
end
---@return RedRob.AiBase
function AiMgr.CreateAi(aiType)
    return RedRob.PoolMgr.GetAiFromPool(aiType)
end
---@param ai RedRob.AiBase
function AiMgr.AiToPool(ai)
    ai:BaseDestroy()
    return RedRob.PoolMgr.ReturnAiToPool(ai)
end